﻿using Book_WebAPI.Models;

namespace Book_WebAPI.Data
{
    public class BookMockData
    {
        // 获取BookMockData实例
        public static BookMockData BookForAuthor { get; } = new BookMockData(); // 静态属性，返回BookMockData的实例。
        public List<Author> Authors { get; set; } // 集合属性，作者实例集合。
        public List<Book> Books { get; set; } // 集合属性，图书实例属性。

        // 构造函数
        public BookMockData()
        {
            Authors = new List<Author>
            {
                new Author { 
                    id=1,
                    age=48,
                    name="罗贯中",
                    email="author1@qq.com"
                },
                new Author {
                    id=2,
                    age=50,
                    name="吴承恩",
                    email="author2@qq.com"
                },
                new Author {
                    id=3,
                    age=45,
                    name="舒庆春",
                    email="author3@qq.com"
                },
                new Author {
                    id=4,
                    age=78,
                    name="司马迁",
                    email="author4@qq.com"
                },
                new Author {
                    id=5,
                    age=40,
                    name="孙武",
                    email="author5@qq.com"
                },
                new Author {
                    id=6,
                    age=45,
                    name="鲁迅",
                    email="author6@qq.com"
                },
                new Author {
                    id=7,
                    age=59,
                    name="唐家三少",
                    email="author7@qq.com"
                },
                new Author {
                    id=8,
                    age=35,
                    name="塞万提斯",
                    email="author8@qq.com"
                },
                new Author {
                    id=9,
                    age=52,
                    name="莎士比亚",
                    email="author9@qq.com"
                },
                new Author {
                    id=10,
                    age=75,
                    name="余华",
                    email="author10@qq.com"
                },
            };

            Books = new List<Book>
            {
                new Book
                {
                    id=1,
                    title="《西游记》",
                    description="师徒四人向西天拜佛求经的故事。",
                    pages="100章",
                    authorId=2
                },
                new Book
                {
                    id=2,
                    title="《骆驼祥子》",
                    description="一个乡下老实人进城打拼，从淳朴到陨落的故事。",
                    pages="69章",
                    authorId=3
                },
                new Book
                {
                    id=3,
                    title="《三国演义》",
                    description="三个国家之间的战争。",
                    pages="125章",
                    authorId=1
                },
                new Book
                {
                    id=4,
                    title="《四世同堂》",
                    description="一个家族四代人的人情世故。",
                    pages="50章",
                    authorId=3
                },
                new Book
                {
                    id=5,
                    title="《孙子兵法》",
                    description="旷古兵书，永不过时。",
                    pages="36章",
                    authorId=5
                },
                new Book
                {
                    id=6,
                    title="《活着》",
                    description="所爱的人慢慢的离自己而去，真的很痛苦。",
                    pages="100章",
                    authorId=10
                },
                new Book
                {
                    id=7,
                    title="《呐喊》",
                    description="从辛亥革命到五四运动，社会生活的真实写照。",
                    pages="30章",
                    authorId=6
                },
                new Book
                {
                    id=8,
                    title="《狂人日记》",
                    description="以第一人称口吻叙述一个“狂人”的故事。",
                    pages="28章",
                    authorId=6
                },
                new Book
                {
                    id=9,
                    title="《史记》",
                    description="第一步编年体通史。",
                    pages="13章",
                    authorId=4
                },
                new Book
                {
                    id=10,
                    title="《唐吉坷德》",
                    description="面对现实，忠于理想。",
                    pages="75章",
                    authorId=8
                },
                new Book
                {
                    id=11,
                    title="《斗罗大陆》",
                    description="唐门弟子的异世界成神之路。",
                    pages="500章",
                    authorId=7
                },
                new Book
                {
                    id=12,
                    title="《罗密欧与朱丽叶》",
                    description="这个就是爱情。",
                    pages="48章",
                    authorId=9
                },
            };
        }
    }
}
